<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #box{
      /* 自动继承 */
      color: red;
      font-size: 20px;
      text-align: center;
      line-height: 40px;
      /* 不能自动继承 */
      border: 1px solid green;
    }

    h1{
      /* 手动继承 */
      border: inherit;
    }
  </style>
</head>
<body>
  <div id="box">
    xxxxxx
    <p>aaaaa</p>
    <h1>bbbbb</h1>
  </div>
</body>
</html>